/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;

public class PeriksaYudisiumTableModel extends AbstractTableModel {

    String columNames[] = {"nama", "nim", "nomor_hp",  "prodi", "email","periode_bulan", "periode_hari", "periode_tanggal"
    ,"persetujuan_nilai","pengesahan_skripsi", "bebaspinjam_lab", "bebaspinjam_dosen"
    ,"bukti_kp", "fotocopy_tkbi", "fotocopy_ta", "sistem_poin", "bukti_rbm", "status"};
    private ArrayList<Yudisium> data;

    public PeriksaYudisiumTableModel() {
    }

    public PeriksaYudisiumTableModel(ArrayList<Yudisium> data) {
        this.data = data;
    }

    public int getRowCount() {
        return getData().size();
    }

    public int getColumnCount() {
        return columNames.length;
    }


    @Override
    public String getColumnName(int col) {
        return columNames[col];
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Yudisium temp = getData().get(rowIndex);
        if (columnIndex == 0) {
            return temp.getNama();
        } else if (columnIndex == 1) {
            return temp.getNim();
        } else if (columnIndex == 2) {
            return temp.getNoHp();
        } else if (columnIndex == 3) {
            return temp.getProdi();
        } else if (columnIndex == 4 ){
            return temp.getEmail();
        } else if (columnIndex == 5 ){
            return temp.getPeriode();
        } else if (columnIndex == 6 ){
            return temp.getHari();
        } else if (columnIndex == 7 ){
            return temp.getTanggal();
        } else if (columnIndex == 8 ){
            return temp.getPersetujuan_nilai();
        } else if (columnIndex == 9 ){
            return temp.getPengesahan_skripsi();
        } else if (columnIndex == 10 ){
            return temp.getBebaspinjam_lab();
        } else if (columnIndex == 11 ){
            return temp.getBebaspinjam_dosen();
        } else if (columnIndex == 12 ){
            return temp.getBukti_kp();
        } else if (columnIndex == 13 ){
            return temp.getFotocopy_tkbi();
        } else if (columnIndex == 14 ){
            return temp.getFotocopy_ta();
        } else if (columnIndex == 15 ){
            return temp.getSistem_poin();
        } else if (columnIndex == 16 ){
            return temp.getBukti_rbm();
        } else {
            return temp.getStatus();
        }
    }

    public ArrayList<Yudisium> getData() {
        return data;
    }

    public void setData(ArrayList<Yudisium> data) {
        this.data = data;
    }
}

